package feiyanren.com;

public class A01_Demo1 {
    public static void main(String[] args) {
        int[] arr = {5,4,3,2,1};
        int[] arr_sort = sort(arr);
        for(int i=0;i<arr_sort.length;i++){
            System.out.println(arr_sort[i]);
        }
    }
    public static int[] sort(int[] arr){
        for(int i=0;i<arr.length-1;i++){
            for(int j=arr.length-1;j>i;j--){
                if(arr[j-1] > arr[j]){
                    int temp = arr[j - 1];
                    arr[j - 1] = arr[j];
                    arr[j] = temp;
                }
            }
        }
        return arr;
    }
}
